import { SET_LIST, HomeAction } from "./homeAction";
export interface ListItem {
  title: string;
  desc: string;
  url: string;
  id: string;
  price: number;
}

export interface HomeState {
  list: ListItem[];
}

const initState: HomeState = {
  list: [],
};

export default (state = initState, action: HomeAction) => {
  switch (action.type) {
    case SET_LIST: {
      return {
        ...state,
        list: action.payload,
      };
    }
    default:
      return state;
  }
};
